package com.lesson00;

import java.awt.*;

public class TestFrame {

    public static void main(String[] args) {
        // 创建窗口对象
        MyFrame myFrame1 = new MyFrame(100,100,200,200,Color.blue);
        MyFrame myFrame2 = new MyFrame(300,100,200,200,Color.blue);
        MyFrame myFrame3 = new MyFrame(100,300,200,200,Color.blue);
        MyFrame myFrame4 = new MyFrame(300,300,200,200,Color.blue);
    }
}
class MyFrame extends Frame {
    static  int id = 0;//窗口编号

    public MyFrame(int x,int y,int w,int h,Color color)
    {
        super("Myframe"+(++id));
        setVisible(true);//可见性
        setBounds(x,y,w,h);//设置大小位置
        setBackground(color);//背景颜色
    }
}